package api

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

func SendVerifyCode(c *gin.Context) {
	var req struct {
		Email string `json:"email" binding:"required,email"`
	}

	if err := c.ShouldBindJSON(&req); err != nil {
		c.JSON(http.StatusBadRequest, gin.H{
			"code": 400,
			"msg":  "邮箱格式错误",
		})
		return
	}

	// if err := service.SendVerifyCode(context.Background(), config.RedisClient, req.Email); err != nil {
	// 	c.JSON(http.StatusInternalServerError, gin.H{
	// 		"code": 500,
	// 		"msg":  "发送失败",
	// 		"data": err.Error(),
	// 	})
	// 	return
	// }

	c.JSON(http.StatusOK, gin.H{
		"code": 200,
		"msg":  "发送成功",
	})
}
